//
//  ViewController.swift
//  GHSwiftProject
//
//  Created by Guanghui Liao on 4/5/18.
//  Copyright © 2018 liaoworking. All rights reserved.
//  15382547281   263228

import UIKit
import RxSwift
import RxCocoa
class ViewController: UIViewController {
    let disposeBag = DisposeBag()
    override func viewDidLoad() {
        super.viewDidLoad()
        //    15382546821
        //035409
        view.backgroundColor = UIColor.darkGray

        testBtn()
        testLocation()

    }

    func testBtn() {
        let testBtn = UIButton(frame: CGRect(x: 80, y: 220, width: 80, height: 30))
        testBtn.backgroundColor = UIColor.red
        testBtn.setTitle("TESTT", for: .normal)
        view.addSubview(testBtn)
                testBtn.rx.tap.subscribe(onNext: {
                    print("点击按钮")
                }).disposed(by: disposeBag)
    }

    
    func testLocation() {
        GHLocationManager.shared.startLocating(showAlert: true).didLocatedBlock = { (longi, lati) in
            print("首页的调取了一次")
            print(longi)
            print(lati)            
        }
        
    }
    
//    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
//        super.touchesBegan(touches, with: event)
//        testsetterGetter()
//    }
    
    func testsetterGetter() {
        print("testBG")
//        showMsg("hehe", nil)
        showRequestHUD(nil, nil)
            print(AppCenter.shared.userModel.name ?? "第二次没有值")

    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}




class GHItem: HandyJSON{
    var title:  String?
    var ga_prefix: String?
    var images: String?
    var multipic: String?
    var type: Int?
    var id: Int?
    
    //用HandyJSON必须要实现这个方法
    required init() {}
}
